
const game = {
    status: {
        waiting: 'waiting',
        counting: 'counting',
        gaming: 'gaming',
    },
    directions: {
        up: { x: 0, y: -1 },
        down: { x: 0, y: 1 },
        left: { x: -1, y: 0 },
        right: { x: 1, y: 0 },
    },
    tick: {
        fps: 25,
        step: 5,
        count: 3, //倒计时3秒
        breath: 2, //呼吸效果
    },
    render: {
        size: 40
    },
    asTime(tick) {
        const totalSecond = Math.ceil(tick / game.tick.fps);
        const minutes = Math.floor(totalSecond / 60);
        const second = totalSecond % 60;
        const ms = Math.floor(tick % game.tick.fps * 1000 / game.tick.fps);
        return (minutes < 10 ? '0' + minutes : minutes) + ':' + (second < 10 ? '0' + second : second) + '.' + (ms < 10 ? '00' + ms : ms < 100 ? '0' + ms : ms);
    }
};
const server = {
    port: process.env.app_port || 9008,
    host: process.env.app_host || '0.0.0.0',
    name: '迷宫救援',
    teams: [ { color: 'white' } ],
    team: {
        size: 25,
        min: 1,
        regroup: 1,
    },
    login: false,
    control: {
        directions: 'four',
        // x: true,
        // y: true
    },
    home: 'http://www.gamerwant.com/'
};

module.exports = {
    game, server
};
